For example, consider the alternate square() function, with no return value:
void square(float *f_ptr)
{
*f_ptr = (*f_ptr) * (*f_ptr);
}
This function may be called from another function as:
square(&the_value);
The value contained in the variable the_value is thus squared.
This technique is also used when passing an array to a function, since the array name is treated as a pointer to the zeroth element of the array. To pass this pointer as an argument, the array identifier is given without brackets. An example is the following function which squares each element of an array containing 3 elements.